class Shop::ShopsController < ShopController

  def edit
    @shop = Shop.find params[:id]
  end

  def update
    @shop = Shop.find params[:id]
    if @shop.update shop_params
      redirect_to edit_shop_shop_path(@shop), notice: "更新成功！"
    else
      redirect_to new_shop_shop_path, notice: "更新失败！"
    end
  end

  private

  def shop_params
    params.require(:shop).permit(:name, :phone, :intro, :avatar, :big_avatar, :level, :idcard_front, :idcard_back, :license, :province_id, :city_id, :district_id, :address, :shop_type_id, :bank, :bank_account, :bank_account_name)
  end
  
end
